In recent years, media for recording and transmitting digital-coded and multiplexed video signals, audio signals, and additional information signals such as subtitle information have spread rapidly, like a video CD, a DVD, and digital CS broadcasting. However, in order to spread apparatuses for reproducing the above-described coded and multiplexed digital signals for domestic use or the like, keeping cost down of the reproduction apparatuses is indispensable. For this purpose, it is required to implement a demultiplexer for demultiplexing the multiplexed signal and a decoder for decoding the demultiplexed digital signals, with simple and compact circuit constructions.
By the way, in such digital media, a coding method defined by MPEG standard is generally used for video signals. On the other hand, for audio signals, coding methods other than the MPEG coding method are adopted in many cases. For multiplexing of coded video and audio data, a multiplexing method defined by the standard of MPEG system is adopted.
FIG. 3 shows examples of coded data of video information, audio information, and additional information which are multiplexed by using packets. The coded and multiplexed data are subjected to byte alignment. An audio signal and a video signal are respectively digital-coded by an encoder and then multiplexed in packet units by a multiplexer. At the head of each packet, a packet header H is assigned. The packet header H is composed of a synchronous signal S indicating the head of the packet (hereinafter, referred to as a packet start code prefix), an identifier I for indicating that the packet corresponds to one of packets of audio, video, and additional information, packet length information L indicating the length of the packet, a header length HL, video and audio synchronous reproduction information R and the like. After the packet header H, according to the kind of the packet, one of coded data CDP of the video signal, coded data CDS of the audio signal, and coded data CDA of the additional information is assigned. A part from the packet start code prefix to the header end is defined as a system layer, and a coded data part of video, audio, or additional information data after the header is defined as an elementary layer.
When coding a video signal, it is hierarchically coded, and a code sequence indicating the start of the hierarchy and a code sequence indicating the name of the hierarchy are used. The same code sequence is used for the code sequence indicating the start of the hierarchy and the above-mentioned start code prefix indicating the head of the packet.
Usually, since the prefix code of the packet start code appears in the multiplexed data sequence for every data unit indicated by the packet length included in the packet header information, there occurs no mixing of the packet start code prefix and the hierarchy start code of the coded video data.
However, in a packet including coded video data, in contrast with a packet including coded audio data, there is a case where multiplexed data whose packet length is not defined is input. This situation occurs, for example, in a multiplexed data sequence in which a transport packet used for digital CS broadcasting or the like is converted to a PES (Pakettaized Elementary Stream) packet. Hereinafter, a description will be given of the conventional manner of demultiplexing multiplexed data in the case where the packet length of coded video data is not defined.
FIG. 12 is a diagram showing the operation when reading coded video data, wherein a packet boundary of a video packet 1 and a video packet 2 is positioned between (‘x3’) and (‘00’). A read pointer reads data of the video packet 1 in the order of x0, x1, x2, . . . , and the read data are sequentially transmitted to a decoding buffer. The presence of the packet boundary is recognized only when the pointer exceeds the packet boundary to reach ‘EO’ of the video packet 2 and thereby a pattern of (‘00’, ‘00’, ‘01’, ‘E0’) is detected. At this time, the data up to (‘E0’) of the video packet 2 have already been transmitted as effective data to the decoding buffer. So, the read pointer is returned to the packet boundary to perform reading again such that the data corresponding to the pattern of (‘00’, ‘00’, ‘01’, ‘E0’) are not transmitted to the decoding buffer because these data are originally not data to be decoded but data to be utilized in the system.
FIGS. 4(a) and 4(b) show two examples of the case where the hierarchy start code of the coded video data is separated between two packets, as patterns of mistaking the packet boundary.
Initially, the pattern of FIG. 4(a) will be described. In the pattern of FIG. 4(a), the hierarchy start code of the coded video data exists between (‘00’) and (‘00’, ‘01’, ‘00’) such that it is divided into two packets by the packet start code (‘00’, ‘00’, ‘01’, ‘EO’) and the packet header.
In this case, in a start code prefix code detection unit which detects the prefix code of the start code, data is read from an input buffer, and the pattern of the start code prefix code is detected. At this time, the read address of the input buffer is an address α. The start code prefix code detection unit detects the pattern of (‘00’, ‘00’, ‘01’) and, thereafter, informs this to a start code discrimination unit which is positioned in the subsequent stage to activate the start code discrimination unit.
Next, the start code discrimination unit reads data of an address β, and decides whether this is the identifier (‘B9’˜‘FF’) indicating the head of the packet or the hierarchy start code (‘00’˜‘B8’) of the coded video data.
In the pattern of FIG. 4(a), since the data (‘E0’) of the address β is an identifier which indicates the start of the packet, the start code discrimination unit informs that the packet head is detected, to a header analysis unit, thereby activating the header analysis unit.
At this time, since data of address γ is a portion of the coded video data, it is necessary to connect this data to the rear of the following video packet data and transfer the data to the decoding buffer. Therefore, before activating the header analysis unit, in order to execute transfer of the data of address γ, it is necessary to perform an operation of setting the read address of the input buffer from the address β to the address γ which is prior to the address β, and transferring the data of address γ to the decoding buffer. Further, not only transferring the data of address γ, it is necessary to store the information that the data of address γ is a portion of the hierarchy start code of the coded video data.
In the case of FIG. 4(b), after the start code discrimination unit discriminates the identifier that indicates the packet start by the address β, in order to transfer the data of addresses γ and δ which are parts of the coded video data to the decoding buffer, the read address of the input buffer which has been in the address β should be returned to the address γ to control transferring the data of the addresses γ and δ to the decoding buffer. In this case, the pointer is moved longer distance than in the case shown in FIG. 4(a). Further, as in the case of FIG. 4(a), it is necessary to store the information that the data of the addresses γ and δ are parts of the hierarchy start code of the coded video data. The stored information about the possibility that the data (‘00’) of the address γ is a part of the hierarchy start code is used for detection of start codes in units of video reproduction of the coded data part of the next video packet.
In this way, since the length of the video packet is not defined, in the conventional coded signal reproduction apparatus, control of not only advancing the reading pointer of the input buffer is complicated but also returning this at the packet boundary.
To be specific, in the conventional coded signal reproduction apparatus, since data transfer and data discrimination are performed simultaneously by using the read pointer of the same input buffer, the write pointer of the decoding buffer must be advanced excessively to a position where the input data can be identified as data of the system layer, when performing writing. Hence, the write pointer of the decoding buffer is advanced by using a decoding buffer write pointer correction unit. Further, when the input data is data of the system layer, the start code must be detected again, and so the pointer value is once returned. To prevent the input data from being interrupted by this, an input buffer read pointer correction unit is provided to correct the pointer. Further, to prevent the data input to the input buffer from being interrupted, an input buffer protection unit is provided to store the input data, whereby the input data is protected. Therefore, the construction and control of the apparatus are complicated.
Secondly, in reproducing a coded and multiplexed signal, there is a case where header information of packets used for multiplexing must be used. As information required for this, audio and video synchronous reproduction information (PTS) and the like are raised. In many cases, the reproduction information is given in fundamental units of audio and video reproduction. Further, the reproduction information includes, besides the PTS, information indicating the presence or absence of the PTS for each reproduction fundamental unit data included in each packet. In the coded signal decoding apparatus, when the reproduction information is used for reproduction, it is necessary to store the reproduction information by any means. For example, it is thought that the reproduction information is temporarily stored in a memory inside the coded signal decoding apparatus. However, when the reproduction information includes a lot of audio and video reproduction fundamental units to be input to the decoding buffer in a unit time, since the corresponding synchronous reproduction information increases in proportion to them, hardware required as a memory used for storage increases in size, resulting in increased chip area when it is implemented by an LSI.
Thirdly, the reproduction apparatus for video and audio signals employs the pipeline structure in many cases. In the pipeline, a data bus width is defined, and coded data are transferred with the defined bus width to be decoded, but there will occur a case where the last part of the coded data is shorter than the data bus width. In order to control data transfer of the data shorter than the data bus width, it is necessary to perform data transfer control different from the ordinary data transfer, i.e., data transfer control must be performed in the processing pipeline which enables access in 1-byte units, resulting in complicated hardware.
Since the conventional coded signal reproduction apparatus is constructed as described above, in the patterns of FIGS. 4(a) and 4(b), a complicated control circuit which performs control such that the read address of the input buffer at the packet boundary is advanced and then returned back, is required. Further, depending on the data, to store the reproduction information included in the packet header part becomes a factor of increase in the hardware resources such as memories.
The present invention is made to solve the above-mentioned problems, and it is an object of the present invention to provide a coded signal reproduction apparatus which can reproduce a digital signal with less hardware resources, without requiring complicated control.